package com.robotserver.orders.jobs.xxljob;

import com.robotserver.orders.param.JdOrderSyncParam;
import com.robotserver.orders.service.JdOrderService;
import com.robotserver.orders.service.ListenTokenRunService;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class ListenTokenRunSyncXxlJob {
    private static Logger logger = LoggerFactory.getLogger(ListenTokenRunSyncXxlJob.class);

    @Autowired
    private ListenTokenRunService listenTokenRunService;

    /**
     * 调用工具商拉取订单
     * 每30秒钟执行一次拉取订单（时间范围是3分钟）
     */
    @XxlJob("listenTokenRunHandler")
    public void listenTokenRunHandler() throws Exception {
        logger.info("--------ListenTokenRunSyncXxlJob listenTokenRunHandler------监听token运行程序开始------");
        listenTokenRunService.listen();
    }

}
